package com.java.system.controller;

import com.java.system.entity.Menu;
import com.java.system.entity.Result;
import com.java.system.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  菜单权限控制器
 * </p>
 *
 * @author xiaoman
 * @since 2023-07-21
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    IMenuService menuService;
    @GetMapping("/list")
    public Result list(){
        List<Menu> allMenu = menuService.getAllMenu();
        Result result=Result.success();
        result.put("data",allMenu);
        return result;
    }

}
